!% -SD ! author: hvincent@modgethanc.com ! ! written for interactive fiction writing month 2009 ! http://instamatique.com/if ! ! This work is licensed under a Creative Commons ! Attribution 3.0 United States License. Constant Story "Metro Hobo"; Constant Headline "^hvincent zeng^"; !Release 1; Serial "022109"; ! ifmonth 2009 week one assignment Release 2; Serial "030309"; ! ifmonth 2009 week two assignment Include "Parser"; Include "Verblib"; !------ classes Class Room with cant_go "There isn't much to do over there.", has light; Class Prop with before [; Examine: return false; default: print_ret "Don't worry about it."; ], has scenery; !------ objects Room entrance "Entrance to the metro" with description "Calling it an 'entrance' is a bit of a glorification; the area you currently stand is the limbo zone between the westerly stairs and escalator that lead up to the street and the actual subway station to the east. There isn't really much else here.", in_to station, e_to station, has ; Object jacket "dirty jacket" entrance with description "A dirty jacket found on the floor of the metro station.", name 'jacket' 'dirty' 'coat', has clothing; !========== Room station "A metro station" with description "Inside the station proper, you feel comfortably at home. A breeze comes down from the street to the west and gets trapped against the corner, throwing bits of trash everywhere. A ticketing machine blinks from its spot along the south wall, with a change machine keeping it company. The window to the operator's booth is dingy; the booth itself is dark. No one's here to answer any questions; instead, the wall next to the booth is papered with torn and faded information posters.^ ^A row of turnstiles to the north separate the station from the platform.", n_to turnstile, w_to entrance, out_to entrance, has ; Prop poster "informative poster" station with description "NO SMOKING^ NO RADIO WITHOUT HEADPHONES^ NO SOLICITING OR GAMBLING", name 'poster' 'posters' 'sign' 'information' 'informative', has ; Prop booth "operator's booth" station with description "If the operator were here, he'd be able to answer all sorts of useful questions regarding the metro transit system. However, the booth is dark and empty, just like the rest of the station.", name 'booth' 'operator' 'window', has ; Prop trash "trash" station with description "Detritus left by other people; receipts, ticket stubs, gum wrappers, empty bottles. Nothing useful.", name 'trash' 'junk' 'litter', has ; Object ticket_machine "ticketing machine" station with description "This machine will take your money and give you a ticket for the metro.", before [; Search: print_ret "This machine is full of tickets; if only you gave it money, you could take one."; ], name 'ticketing' 'machine' 'dispenser' 'ticket', has scenery container open; Object change_machine "change machine" station with description "Give it bills and it will give you coins. Sometimes people forget to take their change out of the slot.", before [; Search: if (coins notin change_machine) print_ret "You check in the coin slot, but don't find anything."; ], name 'change' 'machine' 'slot' 'return', has scenery container open; Object coins "pile of coins" station with description "A pile of coins; fortunately for you, they add up to exact change for a one-way fare. Lucky!", name 'coins' 'coin' 'pile' 'of', before [; Insert: if (second == change_machine) { move self to change_machine; print_ret "You put the coins back into the change machine."; } else if (second == ticket_machine) { remove self; move ticket to station; print "The ticket machine spits out a ticket.^"; } return true; ], has ; Object ticket "ticket" with description "A ticket for the metro. Good for a single adult one-way fare today.", name 'ticket' 'fare' 'token', before [; Insert: if (second == turnstile) { remove self; print "You put the ticket in the turnstile. It whirrs for a moment as it chews on the little piece of paper, then pulls you through to the platform.^"; PlayerTo(platform); return true; } else { print_ret "That's not where the ticket goes."; } ], has ; Object turnstile "turnstile" station with description "As long as you give one of the turnstiles a ticket, you'll be able to go through.", name 'turnstile' 'turnstiles' 'turnstyle' 'turnstyles' 'gate' 'turn', when_closed "You can't go that way without a ticket.", when_open "Your valid ticket unlocks tthe turnstile", door_to platform, door_dir e_to, with_key ticket, has scenery door openable lockable locked; !========== Room platform "A platform" with description "The platform. Metro cars periodically rush by; northbound trains board on the east side, southbound to the west. The station lies directly south.", each_turn [; print "^You ride the subway to your heart's content."; deadflag = 2; ], s_to station, has ; !------ initialize [ Initialise; location = entrance; lookmode = 2; player.description = "a smelly hobo"; move coins to change_machine; print_ret "Just another day as a hobo on the trains...^"; ]; Include "Grammar";